From: Ian Campbell Date: Tue, 24 May 2011 16:52:02 +0000 (+0100) Subject: tools: ocaml: remove non-posix-ism from sed script. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10306 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=63cd6b046b65ac1fda203ea1ee62717011f17a6a;p=xen.git tools: ocaml: remove non-posix-ism from sed script. Christoph Egger reported than on NetBSD the build fails with Parsing tools/ocaml/libs/xl/../../../../tools/libxl/libxl.idl sed: 1: "1i(*\ * AUTO-GENERATED ...": command i expects \ followed by test gmake[7]: Leaving directory `tools/ocaml/libs/xl' The following was tested by Christoph on NetBSD and also with GNU-sed with and without the --posix flag. In addition when sed fails will still create the output file, which confuses subsequent make invocations. Generate to a temporary file and move into place only on success. Signed-off-by: Ian Campbell Acked-by: Christoph Egger Committed-by: Ian Jackson --- diff --git a/tools/ocaml/libs/xl/Makefile b/tools/ocaml/libs/xl/Makefile index decdf62a5a..342dc3511a 100644 --- a/tools/ocaml/libs/xl/Makefile +++ b/tools/ocaml/libs/xl/Makefile @@ -17,29 +17,33 @@ xl_C_OBJS = xl_stubs OCAML_LIBRARY = xl -GENERATED_FILES += xl.ml xl.mli +GENERATED_FILES += xl.ml xl.ml.tmp xl.mli xl.mli.tmp GENERATED_FILES += _libxl_types.ml.in _libxl_types.mli.in GENERATED_FILES += _libxl_types.inc all: $(INTF) $(LIBS) xl.ml: xl.ml.in _libxl_types.ml.in - $(Q)sed -e '1i(*\ + $(Q)sed -e '1i\ +(*\ * AUTO-GENERATED FILE DO NOT EDIT\ * Generated from xl.ml.in and _libxl_types.ml.in\ *)\ ' \ -e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.ml.in' \ - < xl.ml.in > xl.ml + < xl.ml.in > xl.ml.tmp + $(Q)mv xl.ml.tmp xl.ml xl.mli: xl.mli.in _libxl_types.mli.in - $(Q)sed -e '1i(*\ + $(Q)sed -e '1i\ +(*\ * AUTO-GENERATED FILE DO NOT EDIT\ * Generated from xl.mli.in and _libxl_types.mli.in\ *)\ ' \ -e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.mli.in' \ - < xl.mli.in > xl.mli + < xl.mli.in > xl.mli.tmp + $(Q)mv xl.mli.tmp xl.mli _libxl_types.ml.in _libxl_types.mli.in _libxl_types.inc: genwrap.py $(XEN_ROOT)/tools/libxl/libxl.idl \ $(XEN_ROOT)/tools/libxl/libxltypes.py